<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>SDL_gfx: I:/Sources/sdlgfx/SDL_gfxBlitFunc.c Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />



</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">SDL_gfx
   &#160;<span id="projectnumber">2.0.25</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.8.0 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<div class="title">I:/Sources/sdlgfx/SDL_gfxBlitFunc.c</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_s_d_l__gfx_blit_func_8c.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* </span>
<a name="l00002"></a>00002 <span class="comment"></span>
<a name="l00003"></a>00003 <span class="comment">SDL_gfxBlitFunc.c: custom blitters</span>
<a name="l00004"></a>00004 <span class="comment"></span>
<a name="l00005"></a>00005 <span class="comment">Copyright (C) 2001-2012  Andreas Schiffler</span>
<a name="l00006"></a>00006 <span class="comment"></span>
<a name="l00007"></a>00007 <span class="comment">This software is provided &#39;as-is&#39;, without any express or implied</span>
<a name="l00008"></a>00008 <span class="comment">warranty. In no event will the authors be held liable for any damages</span>
<a name="l00009"></a>00009 <span class="comment">arising from the use of this software.</span>
<a name="l00010"></a>00010 <span class="comment"></span>
<a name="l00011"></a>00011 <span class="comment">Permission is granted to anyone to use this software for any purpose,</span>
<a name="l00012"></a>00012 <span class="comment">including commercial applications, and to alter it and redistribute it</span>
<a name="l00013"></a>00013 <span class="comment">freely, subject to the following restrictions:</span>
<a name="l00014"></a>00014 <span class="comment"></span>
<a name="l00015"></a>00015 <span class="comment">1. The origin of this software must not be misrepresented; you must not</span>
<a name="l00016"></a>00016 <span class="comment">claim that you wrote the original software. If you use this software</span>
<a name="l00017"></a>00017 <span class="comment">in a product, an acknowledgment in the product documentation would be</span>
<a name="l00018"></a>00018 <span class="comment">appreciated but is not required.</span>
<a name="l00019"></a>00019 <span class="comment"></span>
<a name="l00020"></a>00020 <span class="comment">2. Altered source versions must be plainly marked as such, and must not be</span>
<a name="l00021"></a>00021 <span class="comment">misrepresented as being the original software.</span>
<a name="l00022"></a>00022 <span class="comment"></span>
<a name="l00023"></a>00023 <span class="comment">3. This notice may not be removed or altered from any source</span>
<a name="l00024"></a>00024 <span class="comment">distribution.</span>
<a name="l00025"></a>00025 <span class="comment"></span>
<a name="l00026"></a>00026 <span class="comment">Andreas Schiffler -- aschiffler at ferzkopp dot net</span>
<a name="l00027"></a>00027 <span class="comment"></span>
<a name="l00028"></a>00028 <span class="comment">*/</span>
<a name="l00029"></a>00029 
<a name="l00030"></a>00030 <span class="preprocessor">#include &quot;<a class="code" href="_s_d_l__gfx_blit_func_8h.html">SDL_gfxBlitFunc.h</a>&quot;</span>
<a name="l00031"></a>00031 
<a name="l00039"></a><a class="code" href="_s_d_l__gfx_blit_func_8h.html#a6d0c17342154e14322a281603960691a">00039</a> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="_s_d_l__gfx_blit_func_8c.html#a6d0c17342154e14322a281603960691a" title="Alpha adjustment table for custom blitter.">GFX_ALPHA_ADJUST_ARRAY</a>[256] = {
<a name="l00040"></a>00040         0,  <span class="comment">/* 0 */</span>
<a name="l00041"></a>00041         15,  <span class="comment">/* 1 */</span>
<a name="l00042"></a>00042         22,  <span class="comment">/* 2 */</span>
<a name="l00043"></a>00043         27,  <span class="comment">/* 3 */</span>
<a name="l00044"></a>00044         31,  <span class="comment">/* 4 */</span>
<a name="l00045"></a>00045         35,  <span class="comment">/* 5 */</span>
<a name="l00046"></a>00046         39,  <span class="comment">/* 6 */</span>
<a name="l00047"></a>00047         42,  <span class="comment">/* 7 */</span>
<a name="l00048"></a>00048         45,  <span class="comment">/* 8 */</span>
<a name="l00049"></a>00049         47,  <span class="comment">/* 9 */</span>
<a name="l00050"></a>00050         50,  <span class="comment">/* 10 */</span>
<a name="l00051"></a>00051         52,  <span class="comment">/* 11 */</span>
<a name="l00052"></a>00052         55,  <span class="comment">/* 12 */</span>
<a name="l00053"></a>00053         57,  <span class="comment">/* 13 */</span>
<a name="l00054"></a>00054         59,  <span class="comment">/* 14 */</span>
<a name="l00055"></a>00055         61,  <span class="comment">/* 15 */</span>
<a name="l00056"></a>00056         63,  <span class="comment">/* 16 */</span>
<a name="l00057"></a>00057         65,  <span class="comment">/* 17 */</span>
<a name="l00058"></a>00058         67,  <span class="comment">/* 18 */</span>
<a name="l00059"></a>00059         69,  <span class="comment">/* 19 */</span>
<a name="l00060"></a>00060         71,  <span class="comment">/* 20 */</span>
<a name="l00061"></a>00061         73,  <span class="comment">/* 21 */</span>
<a name="l00062"></a>00062         74,  <span class="comment">/* 22 */</span>
<a name="l00063"></a>00063         76,  <span class="comment">/* 23 */</span>
<a name="l00064"></a>00064         78,  <span class="comment">/* 24 */</span>
<a name="l00065"></a>00065         79,  <span class="comment">/* 25 */</span>
<a name="l00066"></a>00066         81,  <span class="comment">/* 26 */</span>
<a name="l00067"></a>00067         82,  <span class="comment">/* 27 */</span>
<a name="l00068"></a>00068         84,  <span class="comment">/* 28 */</span>
<a name="l00069"></a>00069         85,  <span class="comment">/* 29 */</span>
<a name="l00070"></a>00070         87,  <span class="comment">/* 30 */</span>
<a name="l00071"></a>00071         88,  <span class="comment">/* 31 */</span>
<a name="l00072"></a>00072         90,  <span class="comment">/* 32 */</span>
<a name="l00073"></a>00073         91,  <span class="comment">/* 33 */</span>
<a name="l00074"></a>00074         93,  <span class="comment">/* 34 */</span>
<a name="l00075"></a>00075         94,  <span class="comment">/* 35 */</span>
<a name="l00076"></a>00076         95,  <span class="comment">/* 36 */</span>
<a name="l00077"></a>00077         97,  <span class="comment">/* 37 */</span>
<a name="l00078"></a>00078         98,  <span class="comment">/* 38 */</span>
<a name="l00079"></a>00079         99,  <span class="comment">/* 39 */</span>
<a name="l00080"></a>00080         100,  <span class="comment">/* 40 */</span>
<a name="l00081"></a>00081         102,  <span class="comment">/* 41 */</span>
<a name="l00082"></a>00082         103,  <span class="comment">/* 42 */</span>
<a name="l00083"></a>00083         104,  <span class="comment">/* 43 */</span>
<a name="l00084"></a>00084         105,  <span class="comment">/* 44 */</span>
<a name="l00085"></a>00085         107,  <span class="comment">/* 45 */</span>
<a name="l00086"></a>00086         108,  <span class="comment">/* 46 */</span>
<a name="l00087"></a>00087         109,  <span class="comment">/* 47 */</span>
<a name="l00088"></a>00088         110,  <span class="comment">/* 48 */</span>
<a name="l00089"></a>00089         111,  <span class="comment">/* 49 */</span>
<a name="l00090"></a>00090         112,  <span class="comment">/* 50 */</span>
<a name="l00091"></a>00091         114,  <span class="comment">/* 51 */</span>
<a name="l00092"></a>00092         115,  <span class="comment">/* 52 */</span>
<a name="l00093"></a>00093         116,  <span class="comment">/* 53 */</span>
<a name="l00094"></a>00094         117,  <span class="comment">/* 54 */</span>
<a name="l00095"></a>00095         118,  <span class="comment">/* 55 */</span>
<a name="l00096"></a>00096         119,  <span class="comment">/* 56 */</span>
<a name="l00097"></a>00097         120,  <span class="comment">/* 57 */</span>
<a name="l00098"></a>00098         121,  <span class="comment">/* 58 */</span>
<a name="l00099"></a>00099         122,  <span class="comment">/* 59 */</span>
<a name="l00100"></a>00100         123,  <span class="comment">/* 60 */</span>
<a name="l00101"></a>00101         124,  <span class="comment">/* 61 */</span>
<a name="l00102"></a>00102         125,  <span class="comment">/* 62 */</span>
<a name="l00103"></a>00103         126,  <span class="comment">/* 63 */</span>
<a name="l00104"></a>00104         127,  <span class="comment">/* 64 */</span>
<a name="l00105"></a>00105         128,  <span class="comment">/* 65 */</span>
<a name="l00106"></a>00106         129,  <span class="comment">/* 66 */</span>
<a name="l00107"></a>00107         130,  <span class="comment">/* 67 */</span>
<a name="l00108"></a>00108         131,  <span class="comment">/* 68 */</span>
<a name="l00109"></a>00109         132,  <span class="comment">/* 69 */</span>
<a name="l00110"></a>00110         133,  <span class="comment">/* 70 */</span>
<a name="l00111"></a>00111         134,  <span class="comment">/* 71 */</span>
<a name="l00112"></a>00112         135,  <span class="comment">/* 72 */</span>
<a name="l00113"></a>00113         136,  <span class="comment">/* 73 */</span>
<a name="l00114"></a>00114         137,  <span class="comment">/* 74 */</span>
<a name="l00115"></a>00115         138,  <span class="comment">/* 75 */</span>
<a name="l00116"></a>00116         139,  <span class="comment">/* 76 */</span>
<a name="l00117"></a>00117         140,  <span class="comment">/* 77 */</span>
<a name="l00118"></a>00118         141,  <span class="comment">/* 78 */</span>
<a name="l00119"></a>00119         141,  <span class="comment">/* 79 */</span>
<a name="l00120"></a>00120         142,  <span class="comment">/* 80 */</span>
<a name="l00121"></a>00121         143,  <span class="comment">/* 81 */</span>
<a name="l00122"></a>00122         144,  <span class="comment">/* 82 */</span>
<a name="l00123"></a>00123         145,  <span class="comment">/* 83 */</span>
<a name="l00124"></a>00124         146,  <span class="comment">/* 84 */</span>
<a name="l00125"></a>00125         147,  <span class="comment">/* 85 */</span>
<a name="l00126"></a>00126         148,  <span class="comment">/* 86 */</span>
<a name="l00127"></a>00127         148,  <span class="comment">/* 87 */</span>
<a name="l00128"></a>00128         149,  <span class="comment">/* 88 */</span>
<a name="l00129"></a>00129         150,  <span class="comment">/* 89 */</span>
<a name="l00130"></a>00130         151,  <span class="comment">/* 90 */</span>
<a name="l00131"></a>00131         152,  <span class="comment">/* 91 */</span>
<a name="l00132"></a>00132         153,  <span class="comment">/* 92 */</span>
<a name="l00133"></a>00133         153,  <span class="comment">/* 93 */</span>
<a name="l00134"></a>00134         154,  <span class="comment">/* 94 */</span>
<a name="l00135"></a>00135         155,  <span class="comment">/* 95 */</span>
<a name="l00136"></a>00136         156,  <span class="comment">/* 96 */</span>
<a name="l00137"></a>00137         157,  <span class="comment">/* 97 */</span>
<a name="l00138"></a>00138         158,  <span class="comment">/* 98 */</span>
<a name="l00139"></a>00139         158,  <span class="comment">/* 99 */</span>
<a name="l00140"></a>00140         159,  <span class="comment">/* 100 */</span>
<a name="l00141"></a>00141         160,  <span class="comment">/* 101 */</span>
<a name="l00142"></a>00142         161,  <span class="comment">/* 102 */</span>
<a name="l00143"></a>00143         162,  <span class="comment">/* 103 */</span>
<a name="l00144"></a>00144         162,  <span class="comment">/* 104 */</span>
<a name="l00145"></a>00145         163,  <span class="comment">/* 105 */</span>
<a name="l00146"></a>00146         164,  <span class="comment">/* 106 */</span>
<a name="l00147"></a>00147         165,  <span class="comment">/* 107 */</span>
<a name="l00148"></a>00148         165,  <span class="comment">/* 108 */</span>
<a name="l00149"></a>00149         166,  <span class="comment">/* 109 */</span>
<a name="l00150"></a>00150         167,  <span class="comment">/* 110 */</span>
<a name="l00151"></a>00151         168,  <span class="comment">/* 111 */</span>
<a name="l00152"></a>00152         168,  <span class="comment">/* 112 */</span>
<a name="l00153"></a>00153         169,  <span class="comment">/* 113 */</span>
<a name="l00154"></a>00154         170,  <span class="comment">/* 114 */</span>
<a name="l00155"></a>00155         171,  <span class="comment">/* 115 */</span>
<a name="l00156"></a>00156         171,  <span class="comment">/* 116 */</span>
<a name="l00157"></a>00157         172,  <span class="comment">/* 117 */</span>
<a name="l00158"></a>00158         173,  <span class="comment">/* 118 */</span>
<a name="l00159"></a>00159         174,  <span class="comment">/* 119 */</span>
<a name="l00160"></a>00160         174,  <span class="comment">/* 120 */</span>
<a name="l00161"></a>00161         175,  <span class="comment">/* 121 */</span>
<a name="l00162"></a>00162         176,  <span class="comment">/* 122 */</span>
<a name="l00163"></a>00163         177,  <span class="comment">/* 123 */</span>
<a name="l00164"></a>00164         177,  <span class="comment">/* 124 */</span>
<a name="l00165"></a>00165         178,  <span class="comment">/* 125 */</span>
<a name="l00166"></a>00166         179,  <span class="comment">/* 126 */</span>
<a name="l00167"></a>00167         179,  <span class="comment">/* 127 */</span>
<a name="l00168"></a>00168         180,  <span class="comment">/* 128 */</span>
<a name="l00169"></a>00169         181,  <span class="comment">/* 129 */</span>
<a name="l00170"></a>00170         182,  <span class="comment">/* 130 */</span>
<a name="l00171"></a>00171         182,  <span class="comment">/* 131 */</span>
<a name="l00172"></a>00172         183,  <span class="comment">/* 132 */</span>
<a name="l00173"></a>00173         184,  <span class="comment">/* 133 */</span>
<a name="l00174"></a>00174         184,  <span class="comment">/* 134 */</span>
<a name="l00175"></a>00175         185,  <span class="comment">/* 135 */</span>
<a name="l00176"></a>00176         186,  <span class="comment">/* 136 */</span>
<a name="l00177"></a>00177         186,  <span class="comment">/* 137 */</span>
<a name="l00178"></a>00178         187,  <span class="comment">/* 138 */</span>
<a name="l00179"></a>00179         188,  <span class="comment">/* 139 */</span>
<a name="l00180"></a>00180         188,  <span class="comment">/* 140 */</span>
<a name="l00181"></a>00181         189,  <span class="comment">/* 141 */</span>
<a name="l00182"></a>00182         190,  <span class="comment">/* 142 */</span>
<a name="l00183"></a>00183         190,  <span class="comment">/* 143 */</span>
<a name="l00184"></a>00184         191,  <span class="comment">/* 144 */</span>
<a name="l00185"></a>00185         192,  <span class="comment">/* 145 */</span>
<a name="l00186"></a>00186         192,  <span class="comment">/* 146 */</span>
<a name="l00187"></a>00187         193,  <span class="comment">/* 147 */</span>
<a name="l00188"></a>00188         194,  <span class="comment">/* 148 */</span>
<a name="l00189"></a>00189         194,  <span class="comment">/* 149 */</span>
<a name="l00190"></a>00190         195,  <span class="comment">/* 150 */</span>
<a name="l00191"></a>00191         196,  <span class="comment">/* 151 */</span>
<a name="l00192"></a>00192         196,  <span class="comment">/* 152 */</span>
<a name="l00193"></a>00193         197,  <span class="comment">/* 153 */</span>
<a name="l00194"></a>00194         198,  <span class="comment">/* 154 */</span>
<a name="l00195"></a>00195         198,  <span class="comment">/* 155 */</span>
<a name="l00196"></a>00196         199,  <span class="comment">/* 156 */</span>
<a name="l00197"></a>00197         200,  <span class="comment">/* 157 */</span>
<a name="l00198"></a>00198         200,  <span class="comment">/* 158 */</span>
<a name="l00199"></a>00199         201,  <span class="comment">/* 159 */</span>
<a name="l00200"></a>00200         201,  <span class="comment">/* 160 */</span>
<a name="l00201"></a>00201         202,  <span class="comment">/* 161 */</span>
<a name="l00202"></a>00202         203,  <span class="comment">/* 162 */</span>
<a name="l00203"></a>00203         203,  <span class="comment">/* 163 */</span>
<a name="l00204"></a>00204         204,  <span class="comment">/* 164 */</span>
<a name="l00205"></a>00205         205,  <span class="comment">/* 165 */</span>
<a name="l00206"></a>00206         205,  <span class="comment">/* 166 */</span>
<a name="l00207"></a>00207         206,  <span class="comment">/* 167 */</span>
<a name="l00208"></a>00208         206,  <span class="comment">/* 168 */</span>
<a name="l00209"></a>00209         207,  <span class="comment">/* 169 */</span>
<a name="l00210"></a>00210         208,  <span class="comment">/* 170 */</span>
<a name="l00211"></a>00211         208,  <span class="comment">/* 171 */</span>
<a name="l00212"></a>00212         209,  <span class="comment">/* 172 */</span>
<a name="l00213"></a>00213         210,  <span class="comment">/* 173 */</span>
<a name="l00214"></a>00214         210,  <span class="comment">/* 174 */</span>
<a name="l00215"></a>00215         211,  <span class="comment">/* 175 */</span>
<a name="l00216"></a>00216         211,  <span class="comment">/* 176 */</span>
<a name="l00217"></a>00217         212,  <span class="comment">/* 177 */</span>
<a name="l00218"></a>00218         213,  <span class="comment">/* 178 */</span>
<a name="l00219"></a>00219         213,  <span class="comment">/* 179 */</span>
<a name="l00220"></a>00220         214,  <span class="comment">/* 180 */</span>
<a name="l00221"></a>00221         214,  <span class="comment">/* 181 */</span>
<a name="l00222"></a>00222         215,  <span class="comment">/* 182 */</span>
<a name="l00223"></a>00223         216,  <span class="comment">/* 183 */</span>
<a name="l00224"></a>00224         216,  <span class="comment">/* 184 */</span>
<a name="l00225"></a>00225         217,  <span class="comment">/* 185 */</span>
<a name="l00226"></a>00226         217,  <span class="comment">/* 186 */</span>
<a name="l00227"></a>00227         218,  <span class="comment">/* 187 */</span>
<a name="l00228"></a>00228         218,  <span class="comment">/* 188 */</span>
<a name="l00229"></a>00229         219,  <span class="comment">/* 189 */</span>
<a name="l00230"></a>00230         220,  <span class="comment">/* 190 */</span>
<a name="l00231"></a>00231         220,  <span class="comment">/* 191 */</span>
<a name="l00232"></a>00232         221,  <span class="comment">/* 192 */</span>
<a name="l00233"></a>00233         221,  <span class="comment">/* 193 */</span>
<a name="l00234"></a>00234         222,  <span class="comment">/* 194 */</span>
<a name="l00235"></a>00235         222,  <span class="comment">/* 195 */</span>
<a name="l00236"></a>00236         223,  <span class="comment">/* 196 */</span>
<a name="l00237"></a>00237         224,  <span class="comment">/* 197 */</span>
<a name="l00238"></a>00238         224,  <span class="comment">/* 198 */</span>
<a name="l00239"></a>00239         225,  <span class="comment">/* 199 */</span>
<a name="l00240"></a>00240         225,  <span class="comment">/* 200 */</span>
<a name="l00241"></a>00241         226,  <span class="comment">/* 201 */</span>
<a name="l00242"></a>00242         226,  <span class="comment">/* 202 */</span>
<a name="l00243"></a>00243         227,  <span class="comment">/* 203 */</span>
<a name="l00244"></a>00244         228,  <span class="comment">/* 204 */</span>
<a name="l00245"></a>00245         228,  <span class="comment">/* 205 */</span>
<a name="l00246"></a>00246         229,  <span class="comment">/* 206 */</span>
<a name="l00247"></a>00247         229,  <span class="comment">/* 207 */</span>
<a name="l00248"></a>00248         230,  <span class="comment">/* 208 */</span>
<a name="l00249"></a>00249         230,  <span class="comment">/* 209 */</span>
<a name="l00250"></a>00250         231,  <span class="comment">/* 210 */</span>
<a name="l00251"></a>00251         231,  <span class="comment">/* 211 */</span>
<a name="l00252"></a>00252         232,  <span class="comment">/* 212 */</span>
<a name="l00253"></a>00253         233,  <span class="comment">/* 213 */</span>
<a name="l00254"></a>00254         233,  <span class="comment">/* 214 */</span>
<a name="l00255"></a>00255         234,  <span class="comment">/* 215 */</span>
<a name="l00256"></a>00256         234,  <span class="comment">/* 216 */</span>
<a name="l00257"></a>00257         235,  <span class="comment">/* 217 */</span>
<a name="l00258"></a>00258         235,  <span class="comment">/* 218 */</span>
<a name="l00259"></a>00259         236,  <span class="comment">/* 219 */</span>
<a name="l00260"></a>00260         236,  <span class="comment">/* 220 */</span>
<a name="l00261"></a>00261         237,  <span class="comment">/* 221 */</span>
<a name="l00262"></a>00262         237,  <span class="comment">/* 222 */</span>
<a name="l00263"></a>00263         238,  <span class="comment">/* 223 */</span>
<a name="l00264"></a>00264         238,  <span class="comment">/* 224 */</span>
<a name="l00265"></a>00265         239,  <span class="comment">/* 225 */</span>
<a name="l00266"></a>00266         240,  <span class="comment">/* 226 */</span>
<a name="l00267"></a>00267         240,  <span class="comment">/* 227 */</span>
<a name="l00268"></a>00268         241,  <span class="comment">/* 228 */</span>
<a name="l00269"></a>00269         241,  <span class="comment">/* 229 */</span>
<a name="l00270"></a>00270         242,  <span class="comment">/* 230 */</span>
<a name="l00271"></a>00271         242,  <span class="comment">/* 231 */</span>
<a name="l00272"></a>00272         243,  <span class="comment">/* 232 */</span>
<a name="l00273"></a>00273         243,  <span class="comment">/* 233 */</span>
<a name="l00274"></a>00274         244,  <span class="comment">/* 234 */</span>
<a name="l00275"></a>00275         244,  <span class="comment">/* 235 */</span>
<a name="l00276"></a>00276         245,  <span class="comment">/* 236 */</span>
<a name="l00277"></a>00277         245,  <span class="comment">/* 237 */</span>
<a name="l00278"></a>00278         246,  <span class="comment">/* 238 */</span>
<a name="l00279"></a>00279         246,  <span class="comment">/* 239 */</span>
<a name="l00280"></a>00280         247,  <span class="comment">/* 240 */</span>
<a name="l00281"></a>00281         247,  <span class="comment">/* 241 */</span>
<a name="l00282"></a>00282         248,  <span class="comment">/* 242 */</span>
<a name="l00283"></a>00283         248,  <span class="comment">/* 243 */</span>
<a name="l00284"></a>00284         249,  <span class="comment">/* 244 */</span>
<a name="l00285"></a>00285         249,  <span class="comment">/* 245 */</span>
<a name="l00286"></a>00286         250,  <span class="comment">/* 246 */</span>
<a name="l00287"></a>00287         250,  <span class="comment">/* 247 */</span>
<a name="l00288"></a>00288         251,  <span class="comment">/* 248 */</span>
<a name="l00289"></a>00289         251,  <span class="comment">/* 249 */</span>
<a name="l00290"></a>00290         252,  <span class="comment">/* 250 */</span>
<a name="l00291"></a>00291         252,  <span class="comment">/* 251 */</span>
<a name="l00292"></a>00292         253,  <span class="comment">/* 252 */</span>
<a name="l00293"></a>00293         253,  <span class="comment">/* 253 */</span>
<a name="l00294"></a>00294         254,  <span class="comment">/* 254 */</span>
<a name="l00295"></a>00295         255   <span class="comment">/* 255 */</span>
<a name="l00296"></a>00296 };
<a name="l00297"></a>00297 
<a name="l00306"></a><a class="code" href="_s_d_l__gfx_blit_func_8c.html#a7ec9cde56a58eee4e6182c32dd8cbee7">00306</a> <span class="keywordtype">void</span> <a class="code" href="_s_d_l__gfx_blit_func_8c.html#a7ec9cde56a58eee4e6182c32dd8cbee7" title="Internal blitter using adjusted destination alpha during RGBA-&gt;RGBA blits.">_SDL_gfxBlitBlitterRGBA</a>(<a class="code" href="struct_s_d_l__gfx_blit_info.html" title="The structure passed to the low level blit functions.">SDL_gfxBlitInfo</a> * info)
<a name="l00307"></a>00307 {
<a name="l00308"></a>00308         <span class="keywordtype">int</span>       width = info-&gt;<a class="code" href="struct_s_d_l__gfx_blit_info.html#ad49412925c79a9894ea598530ea39b00">d_width</a>;
<a name="l00309"></a>00309         <span class="keywordtype">int</span>       height = info-&gt;<a class="code" href="struct_s_d_l__gfx_blit_info.html#ad31494204fdd3d2cb30faba527cfb9fa">d_height</a>;
<a name="l00310"></a>00310         Uint8    *src = info-&gt;<a class="code" href="struct_s_d_l__gfx_blit_info.html#a03dd1de15b100cd491eff7d823284189">s_pixels</a>;
<a name="l00311"></a>00311         <span class="keywordtype">int</span>       srcskip = info-&gt;<a class="code" href="struct_s_d_l__gfx_blit_info.html#a25b822e4773e1db6d38aadc5c0bb126f">s_skip</a>;
<a name="l00312"></a>00312         Uint8    *dst = info-&gt;<a class="code" href="struct_s_d_l__gfx_blit_info.html#ae9146d0f8b236274984127a7a1528966">d_pixels</a>;
<a name="l00313"></a>00313         <span class="keywordtype">int</span>       dstskip = info-&gt;<a class="code" href="struct_s_d_l__gfx_blit_info.html#a9055858de99c49d16ef903fed31715b7">d_skip</a>;
<a name="l00314"></a>00314         SDL_PixelFormat *srcfmt = info-&gt;<a class="code" href="struct_s_d_l__gfx_blit_info.html#a1ce90142d08a06fede5e2a13d66d17f6">src</a>;
<a name="l00315"></a>00315         SDL_PixelFormat *dstfmt = info-&gt;<a class="code" href="struct_s_d_l__gfx_blit_info.html#a177d476cb937246853b74253490436db">dst</a>;
<a name="l00316"></a>00316         Uint8       srcbpp = srcfmt-&gt;BytesPerPixel;
<a name="l00317"></a>00317         Uint8       dstbpp = dstfmt-&gt;BytesPerPixel;
<a name="l00318"></a>00318 
<a name="l00319"></a>00319         <span class="keywordflow">while</span> (height--) {
<a name="l00320"></a>00320                 <a class="code" href="_s_d_l__gfx_blit_func_8h.html#a44c498dca765a515f40eecad8f19aac4" title="4-times unrolled DUFFs loop.">GFX_DUFFS_LOOP4</a>( {
<a name="l00321"></a>00321                         Uint32 pixel;
<a name="l00322"></a>00322                         <span class="keywordtype">unsigned</span> sR;
<a name="l00323"></a>00323                         <span class="keywordtype">unsigned</span> sG;
<a name="l00324"></a>00324                         <span class="keywordtype">unsigned</span> sB;
<a name="l00325"></a>00325                         <span class="keywordtype">unsigned</span> sA;
<a name="l00326"></a>00326                         <span class="keywordtype">unsigned</span> dR;
<a name="l00327"></a>00327                         <span class="keywordtype">unsigned</span> dG;
<a name="l00328"></a>00328                         <span class="keywordtype">unsigned</span> dB;
<a name="l00329"></a>00329                         <span class="keywordtype">unsigned</span> dA;
<a name="l00330"></a>00330                         <span class="keywordtype">unsigned</span> sAA;
<a name="l00331"></a>00331                         <a class="code" href="_s_d_l__gfx_blit_func_8h.html#a7dda3984ca04929e2ea0a3679f7452a9" title="Disassemble buffer pointer into a pixel and separate RGBA values.">GFX_DISASSEMBLE_RGBA</a>(src, srcbpp, srcfmt, pixel, sR, sG, sB, sA);
<a name="l00332"></a>00332                         <a class="code" href="_s_d_l__gfx_blit_func_8h.html#a7dda3984ca04929e2ea0a3679f7452a9" title="Disassemble buffer pointer into a pixel and separate RGBA values.">GFX_DISASSEMBLE_RGBA</a>(dst, dstbpp, dstfmt, pixel, dR, dG, dB, dA);
<a name="l00333"></a>00333                         sAA=<a class="code" href="_s_d_l__gfx_blit_func_8c.html#a6d0c17342154e14322a281603960691a" title="Alpha adjustment table for custom blitter.">GFX_ALPHA_ADJUST_ARRAY</a>[sA &amp; 255];
<a name="l00334"></a>00334                         <a class="code" href="_s_d_l__gfx_blit_func_8h.html#ae3efb9e67172838c394c148a62822da6" title="Blend the RGB values of two pixels based on a source alpha value.">GFX_ALPHA_BLEND</a>(sR, sG, sB, sAA, dR, dG, dB);
<a name="l00335"></a>00335                         dA |= sAA;
<a name="l00336"></a>00336                         <a class="code" href="_s_d_l__gfx_blit_func_8h.html#a4e59f926fb98a86c01a4ffc5cc20e8d5" title="Assemble pixel into buffer pointer from separate RGBA values.">GFX_ASSEMBLE_RGBA</a>(dst, dstbpp, dstfmt, dR, dG, dB, dA);
<a name="l00337"></a>00337                         src += srcbpp; dst += dstbpp;
<a name="l00338"></a>00338                 }, width);
<a name="l00339"></a>00339                 src += srcskip;
<a name="l00340"></a>00340                 dst += dstskip;
<a name="l00341"></a>00341         }
<a name="l00342"></a>00342 }
<a name="l00343"></a>00343 
<a name="l00356"></a><a class="code" href="_s_d_l__gfx_blit_func_8c.html#a9375eac21cc799258f971034a3be57b5">00356</a> <span class="keywordtype">int</span> <a class="code" href="_s_d_l__gfx_blit_func_8c.html#a9375eac21cc799258f971034a3be57b5" title="Internal blitter setup wrapper for RGBA-&gt;RGBA blits.">_SDL_gfxBlitRGBACall</a>(SDL_Surface * src, SDL_Rect * srcrect, SDL_Surface * dst, SDL_Rect * dstrect)
<a name="l00357"></a>00357 {
<a name="l00358"></a>00358         <span class="comment">/*</span>
<a name="l00359"></a>00359 <span class="comment">        * Set up source and destination buffer pointers, then blit </span>
<a name="l00360"></a>00360 <span class="comment">        */</span>
<a name="l00361"></a>00361         <span class="keywordflow">if</span> (srcrect-&gt;w &amp;&amp; srcrect-&gt;h) {
<a name="l00362"></a>00362                 <a class="code" href="struct_s_d_l__gfx_blit_info.html" title="The structure passed to the low level blit functions.">SDL_gfxBlitInfo</a> info;
<a name="l00363"></a>00363 
<a name="l00364"></a>00364                 <span class="comment">/*</span>
<a name="l00365"></a>00365 <span class="comment">                * Set up the blit information </span>
<a name="l00366"></a>00366 <span class="comment">                */</span>
<a name="l00367"></a>00367 <span class="preprocessor">#if (SDL_MINOR_VERSION == 3)</span>
<a name="l00368"></a>00368 <span class="preprocessor"></span>                info.<a class="code" href="struct_s_d_l__gfx_blit_info.html#a03dd1de15b100cd491eff7d823284189">s_pixels</a> = (Uint8 *) src-&gt;pixels               + (Uint16) srcrect-&gt;y * src-&gt;pitch + (Uint16) srcrect-&gt;x * src-&gt;format-&gt;BytesPerPixel;
<a name="l00369"></a>00369 #<span class="keywordflow">else</span>
<a name="l00370"></a>00370                 info.<a class="code" href="struct_s_d_l__gfx_blit_info.html#a03dd1de15b100cd491eff7d823284189">s_pixels</a> = (Uint8 *) src-&gt;pixels + src-&gt;offset + (Uint16) srcrect-&gt;y * src-&gt;pitch + (Uint16) srcrect-&gt;x * src-&gt;format-&gt;BytesPerPixel;
<a name="l00371"></a>00371 <span class="preprocessor">#endif</span>
<a name="l00372"></a>00372 <span class="preprocessor"></span>                info.<a class="code" href="struct_s_d_l__gfx_blit_info.html#ad2f7fa9a764e75639fdb6e3b0f8a68fc">s_width</a> = srcrect-&gt;w;
<a name="l00373"></a>00373                 info.<a class="code" href="struct_s_d_l__gfx_blit_info.html#aeeec65f001e54fb93ba97cb85cb61592">s_height</a> = srcrect-&gt;h;
<a name="l00374"></a>00374                 info.<a class="code" href="struct_s_d_l__gfx_blit_info.html#a25b822e4773e1db6d38aadc5c0bb126f">s_skip</a> = (int)(src-&gt;pitch - info.<a class="code" href="struct_s_d_l__gfx_blit_info.html#ad2f7fa9a764e75639fdb6e3b0f8a68fc">s_width</a> * src-&gt;format-&gt;BytesPerPixel);
<a name="l00375"></a>00375 <span class="preprocessor">#if (SDL_MINOR_VERSION == 3)</span>
<a name="l00376"></a>00376 <span class="preprocessor"></span>                info.<a class="code" href="struct_s_d_l__gfx_blit_info.html#ae9146d0f8b236274984127a7a1528966">d_pixels</a> = (Uint8 *) dst-&gt;pixels               + (Uint16) dstrect-&gt;y * dst-&gt;pitch + (Uint16) dstrect-&gt;x * dst-&gt;format-&gt;BytesPerPixel;
<a name="l00377"></a>00377 #<span class="keywordflow">else</span>
<a name="l00378"></a>00378                 info.<a class="code" href="struct_s_d_l__gfx_blit_info.html#ae9146d0f8b236274984127a7a1528966">d_pixels</a> = (Uint8 *) dst-&gt;pixels + dst-&gt;offset + (Uint16) dstrect-&gt;y * dst-&gt;pitch + (Uint16) dstrect-&gt;x * dst-&gt;format-&gt;BytesPerPixel;
<a name="l00379"></a>00379 <span class="preprocessor">#endif</span>
<a name="l00380"></a>00380 <span class="preprocessor"></span>                info.<a class="code" href="struct_s_d_l__gfx_blit_info.html#ad49412925c79a9894ea598530ea39b00">d_width</a> = dstrect-&gt;w;
<a name="l00381"></a>00381                 info.<a class="code" href="struct_s_d_l__gfx_blit_info.html#ad31494204fdd3d2cb30faba527cfb9fa">d_height</a> = dstrect-&gt;h;
<a name="l00382"></a>00382                 info.<a class="code" href="struct_s_d_l__gfx_blit_info.html#a9055858de99c49d16ef903fed31715b7">d_skip</a> = (int)(dst-&gt;pitch - info.<a class="code" href="struct_s_d_l__gfx_blit_info.html#ad49412925c79a9894ea598530ea39b00">d_width</a> * dst-&gt;format-&gt;BytesPerPixel);
<a name="l00383"></a>00383                 info.<a class="code" href="struct_s_d_l__gfx_blit_info.html#a4b938ad61daa0a9625c6892fd46f32a2">aux_data</a> = NULL;
<a name="l00384"></a>00384                 info.<a class="code" href="struct_s_d_l__gfx_blit_info.html#a1ce90142d08a06fede5e2a13d66d17f6">src</a> = src-&gt;format;
<a name="l00385"></a>00385                 info.<a class="code" href="struct_s_d_l__gfx_blit_info.html#a9596f5ea6998964e6240fae7ac17ce1e">table</a> = NULL;
<a name="l00386"></a>00386                 info.<a class="code" href="struct_s_d_l__gfx_blit_info.html#a177d476cb937246853b74253490436db">dst</a> = dst-&gt;format;
<a name="l00387"></a>00387 
<a name="l00388"></a>00388                 <span class="comment">/*</span>
<a name="l00389"></a>00389 <span class="comment">                * Run the actual software blitter </span>
<a name="l00390"></a>00390 <span class="comment">                */</span>
<a name="l00391"></a>00391                 <a class="code" href="_s_d_l__gfx_blit_func_8c.html#a7ec9cde56a58eee4e6182c32dd8cbee7" title="Internal blitter using adjusted destination alpha during RGBA-&gt;RGBA blits.">_SDL_gfxBlitBlitterRGBA</a>(&amp;info);
<a name="l00392"></a>00392                 <span class="keywordflow">return</span> 1;
<a name="l00393"></a>00393         }
<a name="l00394"></a>00394 
<a name="l00395"></a>00395         <span class="keywordflow">return</span> (0);
<a name="l00396"></a>00396 }
<a name="l00397"></a>00397 
<a name="l00411"></a><a class="code" href="_s_d_l__gfx_blit_func_8h.html#ab49c560e89b8305051b2e6b347215f03">00411</a> <span class="keywordtype">int</span> <a class="code" href="_s_d_l__gfx_blit_func_8c.html#ac51ff40d39f3dd0bd08116e8953960f8" title="Blitter for RGBA-&gt;RGBA blits with alpha adjustment.">SDL_gfxBlitRGBA</a>(SDL_Surface * src, SDL_Rect * srcrect, SDL_Surface * dst, SDL_Rect * dstrect)
<a name="l00412"></a>00412 {
<a name="l00413"></a>00413         SDL_Rect  sr, dr;
<a name="l00414"></a>00414         <span class="keywordtype">int</span>       srcx, srcy, w, h;
<a name="l00415"></a>00415 
<a name="l00416"></a>00416         <span class="comment">/*</span>
<a name="l00417"></a>00417 <span class="comment">        * Make sure the surfaces aren&#39;t locked </span>
<a name="l00418"></a>00418 <span class="comment">        */</span>
<a name="l00419"></a>00419         <span class="keywordflow">if</span> (!src || !dst) {
<a name="l00420"></a>00420                 SDL_SetError(<span class="stringliteral">&quot;SDL_UpperBlit: passed a NULL surface&quot;</span>);
<a name="l00421"></a>00421                 <span class="keywordflow">return</span> (-1);
<a name="l00422"></a>00422         }
<a name="l00423"></a>00423         <span class="keywordflow">if</span> ((src-&gt;locked) || (dst-&gt;locked)) {
<a name="l00424"></a>00424                 SDL_SetError(<span class="stringliteral">&quot;Surfaces must not be locked during blit&quot;</span>);
<a name="l00425"></a>00425                 <span class="keywordflow">return</span> (-1);
<a name="l00426"></a>00426         }
<a name="l00427"></a>00427 
<a name="l00428"></a>00428         <span class="comment">/*</span>
<a name="l00429"></a>00429 <span class="comment">        * If the destination rectangle is NULL, use the entire dest surface </span>
<a name="l00430"></a>00430 <span class="comment">        */</span>
<a name="l00431"></a>00431         <span class="keywordflow">if</span> (dstrect == NULL) {
<a name="l00432"></a>00432                 dr.x = dr.y = 0;
<a name="l00433"></a>00433                 dr.w = dst-&gt;w;
<a name="l00434"></a>00434                 dr.h = dst-&gt;h;
<a name="l00435"></a>00435         } <span class="keywordflow">else</span> {
<a name="l00436"></a>00436                 dr = *dstrect;
<a name="l00437"></a>00437         }
<a name="l00438"></a>00438 
<a name="l00439"></a>00439         <span class="comment">/*</span>
<a name="l00440"></a>00440 <span class="comment">        * Clip the source rectangle to the source surface </span>
<a name="l00441"></a>00441 <span class="comment">        */</span>
<a name="l00442"></a>00442         <span class="keywordflow">if</span> (srcrect) {
<a name="l00443"></a>00443                 <span class="keywordtype">int</span>       maxw, maxh;
<a name="l00444"></a>00444 
<a name="l00445"></a>00445                 srcx = srcrect-&gt;x;
<a name="l00446"></a>00446                 w = srcrect-&gt;w;
<a name="l00447"></a>00447                 <span class="keywordflow">if</span> (srcx &lt; 0) {
<a name="l00448"></a>00448                         w += srcx;
<a name="l00449"></a>00449                         dr.x -= srcx;
<a name="l00450"></a>00450                         srcx = 0;
<a name="l00451"></a>00451                 }
<a name="l00452"></a>00452                 maxw = src-&gt;w - srcx;
<a name="l00453"></a>00453                 <span class="keywordflow">if</span> (maxw &lt; w)
<a name="l00454"></a>00454                         w = maxw;
<a name="l00455"></a>00455 
<a name="l00456"></a>00456                 srcy = srcrect-&gt;y;
<a name="l00457"></a>00457                 h = srcrect-&gt;h;
<a name="l00458"></a>00458                 <span class="keywordflow">if</span> (srcy &lt; 0) {
<a name="l00459"></a>00459                         h += srcy;
<a name="l00460"></a>00460                         dr.y -= srcy;
<a name="l00461"></a>00461                         srcy = 0;
<a name="l00462"></a>00462                 }
<a name="l00463"></a>00463                 maxh = src-&gt;h - srcy;
<a name="l00464"></a>00464                 <span class="keywordflow">if</span> (maxh &lt; h)
<a name="l00465"></a>00465                         h = maxh;
<a name="l00466"></a>00466 
<a name="l00467"></a>00467         } <span class="keywordflow">else</span> {
<a name="l00468"></a>00468                 srcx = srcy = 0;
<a name="l00469"></a>00469                 w = src-&gt;w;
<a name="l00470"></a>00470                 h = src-&gt;h;
<a name="l00471"></a>00471         }
<a name="l00472"></a>00472 
<a name="l00473"></a>00473         <span class="comment">/*</span>
<a name="l00474"></a>00474 <span class="comment">        * Clip the destination rectangle against the clip rectangle </span>
<a name="l00475"></a>00475 <span class="comment">        */</span>
<a name="l00476"></a>00476         {
<a name="l00477"></a>00477                 SDL_Rect *clip = &amp;dst-&gt;clip_rect;
<a name="l00478"></a>00478                 <span class="keywordtype">int</span>       dx, dy;
<a name="l00479"></a>00479 
<a name="l00480"></a>00480                 dx = clip-&gt;x - dr.x;
<a name="l00481"></a>00481                 <span class="keywordflow">if</span> (dx &gt; 0) {
<a name="l00482"></a>00482                         w -= dx;
<a name="l00483"></a>00483                         dr.x += dx;
<a name="l00484"></a>00484                         srcx += dx;
<a name="l00485"></a>00485                 }
<a name="l00486"></a>00486                 dx = dr.x + w - clip-&gt;x - clip-&gt;w;
<a name="l00487"></a>00487                 <span class="keywordflow">if</span> (dx &gt; 0)
<a name="l00488"></a>00488                         w -= dx;
<a name="l00489"></a>00489 
<a name="l00490"></a>00490                 dy = clip-&gt;y - dr.y;
<a name="l00491"></a>00491                 <span class="keywordflow">if</span> (dy &gt; 0) {
<a name="l00492"></a>00492                         h -= dy;
<a name="l00493"></a>00493                         dr.y += dy;
<a name="l00494"></a>00494                         srcy += dy;
<a name="l00495"></a>00495                 }
<a name="l00496"></a>00496                 dy = dr.y + h - clip-&gt;y - clip-&gt;h;
<a name="l00497"></a>00497                 <span class="keywordflow">if</span> (dy &gt; 0)
<a name="l00498"></a>00498                         h -= dy;
<a name="l00499"></a>00499         }
<a name="l00500"></a>00500 
<a name="l00501"></a>00501         <span class="keywordflow">if</span> (w &gt; 0 &amp;&amp; h &gt; 0) {
<a name="l00502"></a>00502                 sr.x = srcx;
<a name="l00503"></a>00503                 sr.y = srcy;
<a name="l00504"></a>00504                 sr.w = dr.w = w;
<a name="l00505"></a>00505                 sr.h = dr.h = h;
<a name="l00506"></a>00506                 <span class="keywordflow">return</span> (<a class="code" href="_s_d_l__gfx_blit_func_8c.html#a9375eac21cc799258f971034a3be57b5" title="Internal blitter setup wrapper for RGBA-&gt;RGBA blits.">_SDL_gfxBlitRGBACall</a>(src, &amp;sr, dst, &amp;dr));
<a name="l00507"></a>00507         }
<a name="l00508"></a>00508 
<a name="l00509"></a>00509         <span class="keywordflow">return</span> 0;
<a name="l00510"></a>00510 }
<a name="l00511"></a>00511 
<a name="l00524"></a><a class="code" href="_s_d_l__gfx_blit_func_8h.html#a4627ae4a0037d0b248bed87f3c294735">00524</a> <span class="keywordtype">int</span> <a class="code" href="_s_d_l__gfx_blit_func_8c.html#a09a376775f9d8c933c7121e34fe5ecfc" title="Sets the alpha channel in a 32 bit surface.">SDL_gfxSetAlpha</a>(SDL_Surface *src, Uint8 a)
<a name="l00525"></a>00525 {
<a name="l00526"></a>00526 <span class="preprocessor">#if SDL_BYTEORDER == SDL_BIG_ENDIAN</span>
<a name="l00527"></a>00527 <span class="preprocessor"></span>        <span class="keyword">const</span> <span class="keywordtype">int</span> alpha_offset = 0;
<a name="l00528"></a>00528 <span class="preprocessor">#else</span>
<a name="l00529"></a>00529 <span class="preprocessor"></span>        <span class="keyword">const</span> <span class="keywordtype">int</span> alpha_offset = 3;
<a name="l00530"></a>00530 <span class="preprocessor">#endif</span>
<a name="l00531"></a>00531 <span class="preprocessor"></span>        <span class="keywordtype">int</span> i, j, row_skip;
<a name="l00532"></a>00532         Uint8 *pixels;
<a name="l00533"></a>00533 
<a name="l00534"></a>00534         <span class="comment">/* Check if we have a 32bit surface */</span>
<a name="l00535"></a>00535         <span class="keywordflow">if</span> ( (src==NULL) || 
<a name="l00536"></a>00536                 (src-&gt;format==NULL) || 
<a name="l00537"></a>00537                 (src-&gt;format-&gt;BytesPerPixel!=4) ) {
<a name="l00538"></a>00538                         SDL_SetError(<span class="stringliteral">&quot;SDL_gfxSetAlpha: Invalid input surface.&quot;</span>);
<a name="l00539"></a>00539                         <span class="keywordflow">return</span> -1;
<a name="l00540"></a>00540         }
<a name="l00541"></a>00541 
<a name="l00542"></a>00542         <span class="comment">/*</span>
<a name="l00543"></a>00543 <span class="comment">        * Lock the surface </span>
<a name="l00544"></a>00544 <span class="comment">        */</span>
<a name="l00545"></a>00545         <span class="keywordflow">if</span> (SDL_MUSTLOCK(src)) {
<a name="l00546"></a>00546                 <span class="keywordflow">if</span> (SDL_LockSurface(src) &lt; 0) {
<a name="l00547"></a>00547                         <span class="keywordflow">return</span> (-1);
<a name="l00548"></a>00548                 }
<a name="l00549"></a>00549         }
<a name="l00550"></a>00550 
<a name="l00551"></a>00551         <span class="comment">/* Process */</span>
<a name="l00552"></a>00552         pixels = (Uint8 *)src-&gt;pixels;
<a name="l00553"></a>00553         row_skip = (src-&gt;pitch - (4*src-&gt;w));
<a name="l00554"></a>00554         pixels += alpha_offset;
<a name="l00555"></a>00555         <span class="keywordflow">for</span> ( i=0; i&lt;src-&gt;h; i++ ) {
<a name="l00556"></a>00556                 <span class="keywordflow">for</span> ( j=0; j&lt;src-&gt;w; j++  ) {
<a name="l00557"></a>00557                         *pixels = a; 
<a name="l00558"></a>00558                         pixels += 4;
<a name="l00559"></a>00559                 }
<a name="l00560"></a>00560                 pixels += row_skip;
<a name="l00561"></a>00561         }
<a name="l00562"></a>00562 
<a name="l00563"></a>00563         <span class="comment">/*</span>
<a name="l00564"></a>00564 <span class="comment">        * Unlock surface </span>
<a name="l00565"></a>00565 <span class="comment">        */</span>
<a name="l00566"></a>00566         <span class="keywordflow">if</span> (SDL_MUSTLOCK(src)) {
<a name="l00567"></a>00567                 SDL_UnlockSurface(src);
<a name="l00568"></a>00568         }
<a name="l00569"></a>00569 
<a name="l00570"></a>00570         <span class="keywordflow">return</span> 1; 
<a name="l00571"></a>00571 }
<a name="l00572"></a>00572 
<a name="l00587"></a><a class="code" href="_s_d_l__gfx_blit_func_8h.html#a7c93594525ae349b5cef0156b8f758fc">00587</a> <span class="keywordtype">int</span> <a class="code" href="_s_d_l__gfx_blit_func_8c.html#a4ece530dca0ae46b1f5a780f85371687" title="Multiply the alpha channel in a 32bit surface.">SDL_gfxMultiplyAlpha</a>(SDL_Surface *src, Uint8 a)
<a name="l00588"></a>00588 {
<a name="l00589"></a>00589 <span class="preprocessor">#if SDL_BYTEORDER == SDL_BIG_ENDIAN</span>
<a name="l00590"></a>00590 <span class="preprocessor"></span>        <span class="keyword">const</span> <span class="keywordtype">int</span> alpha_offset = 0;
<a name="l00591"></a>00591 <span class="preprocessor">#else</span>
<a name="l00592"></a>00592 <span class="preprocessor"></span>        <span class="keyword">const</span> <span class="keywordtype">int</span> alpha_offset = 3;
<a name="l00593"></a>00593 <span class="preprocessor">#endif</span>
<a name="l00594"></a>00594 <span class="preprocessor"></span>        <span class="keywordtype">int</span> i, j, row_skip;
<a name="l00595"></a>00595         Uint8 *pixels;
<a name="l00596"></a>00596 
<a name="l00597"></a>00597         <span class="comment">/* Check if we have a 32bit surface */</span>
<a name="l00598"></a>00598         <span class="keywordflow">if</span> ( (src==NULL) || 
<a name="l00599"></a>00599                 (src-&gt;format==NULL) || 
<a name="l00600"></a>00600                 (src-&gt;format-&gt;BytesPerPixel!=4) ) {
<a name="l00601"></a>00601                         SDL_SetError(<span class="stringliteral">&quot;SDL_gfxMultiplyAlpha: Invalid input surface.&quot;</span>);
<a name="l00602"></a>00602                         <span class="keywordflow">return</span> -1;
<a name="l00603"></a>00603         }
<a name="l00604"></a>00604 
<a name="l00605"></a>00605         <span class="comment">/* Check if multiplication is needed */</span>
<a name="l00606"></a>00606         <span class="keywordflow">if</span> (a==255) {
<a name="l00607"></a>00607                 <span class="keywordflow">return</span> 0;
<a name="l00608"></a>00608         }
<a name="l00609"></a>00609 
<a name="l00610"></a>00610         <span class="comment">/*</span>
<a name="l00611"></a>00611 <span class="comment">        * Lock the surface </span>
<a name="l00612"></a>00612 <span class="comment">        */</span>
<a name="l00613"></a>00613         <span class="keywordflow">if</span> (SDL_MUSTLOCK(src)) {
<a name="l00614"></a>00614                 <span class="keywordflow">if</span> (SDL_LockSurface(src) &lt; 0) {
<a name="l00615"></a>00615                         <span class="keywordflow">return</span> (-1);
<a name="l00616"></a>00616                 }
<a name="l00617"></a>00617         }
<a name="l00618"></a>00618 
<a name="l00619"></a>00619         <span class="comment">/* Process */</span>
<a name="l00620"></a>00620         pixels = (Uint8 *)src-&gt;pixels;
<a name="l00621"></a>00621         row_skip = (src-&gt;pitch - (4*src-&gt;w));
<a name="l00622"></a>00622         pixels += alpha_offset;
<a name="l00623"></a>00623         <span class="keywordflow">for</span> ( i=0; i&lt;src-&gt;h; i++ ) {
<a name="l00624"></a>00624                 <span class="keywordflow">for</span> ( j=0; j&lt;src-&gt;w; j++  ) {
<a name="l00625"></a>00625                         *pixels = (Uint8)(((<span class="keywordtype">int</span>)(*pixels)*a)&gt;&gt;8);
<a name="l00626"></a>00626                         pixels += 4;
<a name="l00627"></a>00627                 }
<a name="l00628"></a>00628                 pixels += row_skip;
<a name="l00629"></a>00629         }
<a name="l00630"></a>00630 
<a name="l00631"></a>00631         <span class="comment">/*</span>
<a name="l00632"></a>00632 <span class="comment">        * Unlock surface </span>
<a name="l00633"></a>00633 <span class="comment">        */</span>
<a name="l00634"></a>00634         <span class="keywordflow">if</span> (SDL_MUSTLOCK(src)) {
<a name="l00635"></a>00635                 SDL_UnlockSurface(src);
<a name="l00636"></a>00636         }
<a name="l00637"></a>00637 
<a name="l00638"></a>00638         <span class="keywordflow">return</span> 1;
<a name="l00639"></a>00639 }
</pre></div></div><!-- contents -->


<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.0
</small></address>

</body>
</html>
